<%@ page language="java" import="java.util.*,com.beans.*"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	MemberInfo user = (MemberInfo) session.getAttribute("user");
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>" />
<title>商品列表</title>
<link rel="stylesheet" type="text/css" href="css/basestyle.css"></link>
</head>
<body>
	<div id="div_content">
		<jsp:include
			page='<%=user == null ? "../top.jsp" : "../top_login.jsp"%>'></jsp:include>
		<table id="maintable">

			<tr>
				<td>&nbsp;</td>
				<td><table >
						<tr>
							<td valign="top"><br>
								<TABLE  class="C_Goods_Title">
									<TR>
										<TD class="first_td"><IMG hspace=5
											src="images/NewGoods_04.gif"></TD>
									</TR>
								</TABLE>
								<table >
									<tr bgcolor="#F7F3F7" valign="middle" align="center">
										<td height="30" class="blackTitle">商品图片</td>
										<td height="30" class="blackTitle">商品名称</td>
										<td height="30" class="blackTitle">商品大分类</td>
										<td height="30" class="blackTitle">商品小分类</td>
										<td height="30" class="blackTitle">商品价格</td>

										<td height="30" class="blackTitle">基本操作</td>
									</tr>
									<!--  Jstl 将得到的列表输出商品信息 -->
									<c:forEach var="goods" items="${goodsList}"
										varStatus="GoodsInJspLoop">
										<tr valign="middle" bgcolor="#FFFFFF" align="center">
											<td width="" align="center"><a
												href="goods/goodsInfo.jsp?goodsId=${goods.id}" target=_blank>
													<img
													src="${pageContext.request.contextPath }/GoodsServlet?flag=zhaopian&id=${goods.id }"
													width="60" height="60" border="1">
											</a> <br></td>
											<td width="" class="text">${goods.goodsName}<br>
											</td>
											<td width="" class="text">${goods.bigCateName}<br>
											</td>
											<td width="" class="text">${goods.smallCateName}<br>
											</td>
											<td width="" class="text">￥${goods.price}元 <br>
											</td>

											<td width=""><a
												href="goods/goodsInfo.jsp?goodsId=${goods.id}"><img
													src="images/icon_car.gif" border=0></a><br> <a
												href="ShopCartServlet?flag=add&goodsId=${goods.id}&userId=${userInfoVO.id}"><img
													alt="" src="images/icon_buy.gif" border=0></a> <br></td>
										</tr>
										<tr>
											<td colspan="4" height="2" bgcolor="#F7F3F7"><br></td>
										</tr>
									</c:forEach>
									<tr>
								</table></td>
						</tr>
					</table></td>
			</tr>
			<tr>
				<td colspan="4" height="30" bgcolor="#F7F3F7" class="text"
					align="center"><c:choose>
						<c:when test="${page.hasPre }">
							<a href="GoodsServlet?flag=search&pageIndex=1">首页</a>
							<a href="GoodsServlet?flag=search&pageIndex=${page.pageIndex-1 }">前一页</a>
						</c:when>
						<c:otherwise>
	 		首页
	 		前一页
	 	</c:otherwise>
					</c:choose> <c:choose>
						<c:when test="${page.hasNext}">
							<a href="GoodsServlet?flag=search&pageIndex=${page.pageIndex+1 }">下一页</a>
							<a href="GoodsServlet?flag=search&pageIndex=${page.pageCount }">尾页</a>
						</c:when>
						<c:otherwise>
	 		下一页
	 		尾页
	 	</c:otherwise>
					</c:choose> 去第 <input type="text" name="pageIndex" value="${page.pageIndex }" size="4">页
					<input type="submit" value="GO" /> 第${page.pageIndex }页/共${page.pageCount }页
					总数 ${page.rowCount }</td>
			</tr>
		</table>


		<%@ include file="../bottom.jsp"%>
	</div>

</body>
</html>
